//public TextMesh monsterHurtValueText; void Awake() { stateManager = (StateManager)FindObjectOfType(typeof(StateManager)); bcManager = (BattleCheckManager)FindObjectOfType(typeof(BattleCheckManager)); this.diceStates = new DiceState[battleDice.Length]; for (int i = 0; i < battleDice.Length; i++) { this.diceStates[i] = new DiceState(); } }
void Awake() { DontDestroyOnLoad(this); bcManager = (BattleCheckManager)FindObjectOfType(typeof(BattleCheckManager)); diceStates = new DiceState[battleDice.Length]; for (int i = 0; i < battleDice.Length; i++) { diceStates[i] = new DiceState(); } //if (characterInstance == null) { // characterInstance = this; //} else { // DestroyObject(gameObject); //} _animator = this.GetComponent <Animator> (); }
// Use this for initialization void Start() { singleTap.Tapped += (object sender, System.EventArgs e) => { if (tapable) { Quaternion rotationTemp = Quaternion.identity; rotationTemp.eulerAngles = new Vector3(90f, 0f, 0f); icon = GameObject.Instantiate(selectIcon, Vector3.zero, rotationTemp) as GameObject; icon.transform.parent = this.gameObject.transform; icon.transform.localPosition = Vector3.zero; tapable = false; Rigidbody rigidbodyTemp = this.GetComponent <Rigidbody> (); rigidbodyTemp.constraints = RigidbodyConstraints.FreezeAll; bcm = (BattleCheckManager)FindObjectOfType(typeof(BattleCheckManager)); bcm.lockSelectDice(true, this.GetComponent <Dice>().value); } }; }