public override void Initialize() { base.Initialize(); playerAnim.SetSpell(this, SkillType.WindField); windField = GameObject.Find("WindField").GetComponent <WindField>(); windField.gameObject.SetActive(false); inSprite = windField.transform.Find("WindFieldInSprite").gameObject; inSprite.SetActive(false); outSprite = windField.transform.Find("WindFieldOutSprite").gameObject; outSprite.SetActive(false); }
private void Awake() { GameObject terrain = new GameObject("_Terrain"); GameObject grass = new GameObject("_Grass"); terrain.transform.parent = grass.transform.parent = transform; var mfT = terrain.AddComponent <MeshFilter>(); var mfG = grass.AddComponent <MeshFilter>(); mfT.mesh = FieldMesh.CreateField(_heightMap, _maxHeight, _terrainSize); mfG.mesh = FieldMesh.CreateGrass(_heightMap, _maxHeight, _terrainSize, _frequency); var mrT = terrain.AddComponent <MeshRenderer>(); var mrG = grass.AddComponent <MeshRenderer>(); mrT.material = _terrainMat; mrG.material = _grassMat; windField = GetComponent <WindField>(); }
void Start() { _windField = WindField.instance; }
void Awake() { _instance = this; }