天津23维预案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.3 KiB

3 years ago
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GroundFireControl : MonoBehaviour {
Transform transRanyou;
Transform transFireLG1;
Transform transFireLG2;
Transform transFire;
Transform transRanyou1;
float ranyouScale = 0;
float fireScale = 0;
float growSpeed = .3f;//粒子生长速度;
// Use this for initialization
void Start() {
transRanyou = transform.Find("RanYou");
transFire = transform.Find("fire");
transFireLG1 = transFire.Find("GroundFire_LG1");
transFireLG2 = transFire.Find("GroundFire_LG2");
transRanyou1 = transform.Find("ranyou_01");
transFire.localScale = Vector3.one*.3f;
transFire.gameObject.SetActive(false);
transRanyou1.gameObject.SetActive(false);
transRanyou.localScale = Vector3.zero;
bGrow = true;
//transFireLG1.gameObject.SetActive(false);
//transFireLG2.gameObject.SetActive(false);
//transFireLG1.localScale = Vector3.zero;
//transFireLG2.localScale = Vector3.zero;
}
bool ableOrDisable = false;
// Update is called once per frame
void Update() {
if (bGrow == false) return;
if (growSpeed > 0)
{
growSpeed -= Time.deltaTime;
}
else
{
growSpeed = .1f;
SetRanyouScale();
}
}
void SetRanyouScale()
{
if (transRanyou.gameObject.activeInHierarchy/*&& transRanyou1.gameObject.activeInHierarchy*/)
{
if (transRanyou.localScale.x < .8f)
{
ranyouScale += 0.01f;
transRanyou.localScale = new Vector3(ranyouScale, 0.65f * ranyouScale, ranyouScale);
}
else
{
transRanyou1.gameObject.SetActive(true);
transFire.gameObject.SetActive(true);
bGrow = false;
}
}
}
bool bGrow=false;
//void SetFireScale()
//{
// if (transFire.localScale.x < 1f)
// {
// fireScale += 0.02f;
// transFireLG1.localScale = new Vector3(fireScale, fireScale, fireScale);
// transFireLG2.localScale = new Vector3(fireScale, fireScale, fireScale);
// }
// else {
// bGrow = false;
// }
//}
}