void Start() { currState = AppState.NONE; traAIni = (TranslationAndIntial)gameObject.GetComponent(typeof(TranslationAndIntial)); orienCont = (OrientationControl)gameObject.GetComponent(typeof(OrientationControl)); UIFObj = (UIFollowObject)objCenterIn2D.GetComponent(typeof(UIFollowObject)); }
public void Spawn(TankPart entity) { GameObject healthBarObject = Instantiate(healthBarPrefab, transform); Slider healthSlider = healthBarObject.GetComponentInChildren <Slider>(); UIFollowObject followScript = healthBarObject.GetComponent <UIFollowObject>(); followScript.target = entity.transform; entity.healthSlider = healthSlider; }
void Awake() { currState = AppState.NONE; traAIni = (TranslationAndIntial)gameObject.GetComponent(typeof(TranslationAndIntial)); orienCont = (OrientationControl)gameObject.GetComponent(typeof(OrientationControl)); slidAR = (SlidARScript)gameObject.GetComponent(typeof(SlidARScript)); objectInitialOrientation = 0; UIFObj = (UIFollowObject)objCenterIn2D.GetComponent(typeof(UIFollowObject)); }