Skip to content
Snippets Groups Projects
Commit df513b5b authored by MrWarzo's avatar MrWarzo :speech_balloon:
Browse files

Prototype de déplacement dans le jeu (fonctionnel)

parent 15940ac8
2 merge requests!5Main,!4Main
Showing
with 2033 additions and 79 deletions
fileFormatVersion: 2
guid: 62f0a7022f812374198615871c871952
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Bedroom
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.7169812, g: 0.56161517, b: 0.47686014, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 663c3aa5a06cbfe4b8dc1bdf999296ad
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: dd643e9d54a4a26479ffbcf3b5bf0354
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// UI
using UnityEngine.UI;
public class ArrowsButton : MonoBehaviour
{
private Button arrow;
private GameManager gameManager;
private RoomManager roomManager;
// -1 pour gauche/haut, +1 pour droite/bas
public int direction;
// true pour utiliser en mode flêches, false pour les changements de salle
public bool arrowsOrNProom;
// Start is called before the first frame update
void Start()
{
gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
roomManager = gameManager.room.GetComponent<RoomManager>();
arrow = GetComponent<Button>();
if (arrowsOrNProom)
{
arrow.onClick.AddListener(Arrow);
}
else
{
arrow.onClick.AddListener(NProom);
}
}
// Update is called once per frame
void Update()
{
}
// Action lors du clique sur une flêche
public void Arrow()
{
int viewIndex = roomManager.viewIndex;
roomManager.viewIndex = direction;
gameManager.updateID(roomManager.actualRoom);
}
// Action du clique sur un changement de pièce
public void NProom()
{
int roomIndex = roomManager.roomIndex;
roomManager.roomIndex = direction;
gameManager.updateID(roomManager.actualRoom, roomManager.actualRoomColor);
}
}
fileFormatVersion: 2
guid: 23458ba8043c1354898cc609f72d0f94
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Addon pour les textes améliorés
using TMPro;
// Gestion des scenes
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
private RoomManager _roomManager;
public TextMeshProUGUI textMeshID;
public GameObject room;
// Start is called before the first frame update
void Start()
{
_roomManager = this.room.GetComponent<RoomManager>();
updateID(_roomManager.actualRoom, _roomManager.actualRoomColor );
}
// Update is called once per frame
void Update()
{
}
// Update textMeshID
public void updateID(string newID)
{
textMeshID.text = "ID : " + newID;
}
// Update textMeshID + Room
public void updateID(string newID, Color roomColor)
{
textMeshID.text = "ID : " + newID;
room.GetComponent<Renderer>().material.color = roomColor;
}
}
fileFormatVersion: 2
guid: 5e691edd9c25c6c49945c730794c5f03
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RoomManager : MonoBehaviour
{
public int _viewIndex;
public int _roomIndex;
private string[][] _rooms = {
new string[] {"A2","A1","A3" },
new string[] {"B1"},
new string[] {"C1", "C2", "C3"}
};
private Color[] _roomsColors = { Color.red, Color.green, Color.blue };
public int viewIndex
{
get { return _viewIndex; }
set
{
if (0 < _viewIndex && _viewIndex < _rooms[_roomIndex].Length - 1)
_viewIndex += value;
else if (0 < _viewIndex && value < 0)
_viewIndex += value;
else if (_viewIndex < _rooms[_roomIndex].Length - 1 && value > 0)
_viewIndex += value;
}
}
public int roomIndex
{
get { return _roomIndex; }
set
{
if (0 < _roomIndex && _roomIndex < _rooms.Length)
_roomIndex = _roomIndex + value;
else if (0 < _roomIndex && value < 0)
_roomIndex += value;
else if (_roomIndex < _rooms.Length - 1 && value > 0)
_roomIndex += value;
if( _rooms[_roomIndex].Length < _viewIndex)
_viewIndex = _rooms[_roomIndex].Length - 1;
}
}
public string actualRoom
{
get { return _rooms[_roomIndex][_viewIndex]; }
}
public Color actualRoomColor
{
get
{
return _roomsColors[_roomIndex];
}
}
// Start is called before the first frame update
void Start()
{
_viewIndex = 1;
_roomIndex = 0;
}
}
fileFormatVersion: 2
guid: 8452f8bd090cf944487aeb833adf5c41
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f54d1bd14bd3ca042bd867b519fee8cc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8e7e8f5a82a3a134e91c54efd2274ea9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 1b8d251f9af63b746bf2f7ffe00ebb9b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6ab70aee4d56447429c680537fbf93ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Digitized data copyright (c) 2010 Google Corporation
with Reserved Font Arimo, Tinos and Cousine.
Copyright (c) 2012 Red Hat, Inc.
with Reserved Font Name Liberation.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
fileFormatVersion: 2
guid: 6e59c59b81ab47f9b6ec5781fa725d2c
timeCreated: 1484171296
licenseType: Pro
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: e3265ab4bf004d28a9537516768c1c75
timeCreated: 1484171297
licenseType: Pro
TrueTypeFontImporter:
serializedVersion: 2
fontSize: 16
forceTextureCase: -2
characterSpacing: 1
characterPadding: 0
includeFontData: 1
use2xBehaviour: 0
fontNames: []
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
userData:
assetBundleName:
assetBundleVariant:
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment