private void setupSnowRabbitTypeTrigger() { AnimalTypeTrigger componentInChildren = base.transform.GetComponentInChildren <AnimalTypeTrigger>(true); if (componentInChildren && componentInChildren._type == AnimalType.EuropeanRabbit) { componentInChildren._type = AnimalType.snowRabbit; } }
public void setupFishType() { if (!this.typeCaveFish) { this.fishTypeInt = UnityEngine.Random.Range(0, this.fishTypeMesh.Length); this.mySkin.sharedMaterial = this.fishTypeMat[this.fishTypeInt]; this.mySkin.sharedMesh = this.fishTypeMesh[this.fishTypeInt]; AnimalTypeTrigger component = base.transform.GetComponent <AnimalTypeTrigger>(); if (component) { if (this.fishPrefabTypeInt == 2) { if (this.fishTypeInt == 0) { this.fishNatureGuideValue = 0; } else { this.fishNatureGuideValue = 1; } } else if (this.fishPrefabTypeInt == 4) { if (this.fishTypeInt == 0) { this.fishNatureGuideValue = 2; } else if (this.fishTypeInt == 1) { this.fishNatureGuideValue = 3; } else if (this.fishTypeInt == 2) { this.fishNatureGuideValue = 4; } else if (this.fishTypeInt == 3) { this.fishNatureGuideValue = 5; } } else if (this.fishPrefabTypeInt == 3) { this.fishNatureGuideValue = 6; } component.setupFishType(this.fishNatureGuideValue); } } }
public void setOnSnow(bool onoff) { if (onoff) { if (this.snowMaterial) { this.skin.sharedMaterial = this.snowMaterial; } AnimalTypeTrigger component = base.transform.GetComponent <AnimalTypeTrigger>(); if (component && component._type == AnimalType.EuropeanRabbit) { component._type = AnimalType.snowRabbit; } this.isSnow = true; } else { this.isSnow = false; if (this.normalMat) { this.skin.sharedMaterial = this.normalMat; } } }