/// <summary> /// This sets up the animation when it is created by the FXManager /// </summary> /// <param name="manager"></param> public void Initialize(ROTD_GameManager manager) { // cache the transform for quicker lookup _thisTransform = this.transform; // store the game manager reference _gameManager = manager; // register the user trigger delegate that will notify this class that it has // finished playing its animation boneAnimation.RegisterUserTriggerDelegate(UserTrigger); // start the FX in the dead state State = STATE.Dead; }
/// <summary> /// Set up the pasta from the Pasta Manager /// </summary> /// <param name="manager">Reference to the game manager</param> public void Initialize(ROTD_GameManager manager) { // Set the state to initializing State = STATE.Initializing; // cache some references and perform calculations _gameManager = manager; _thisTransform = transform.transform; _trailTransform = trailParticles.transform; // instantiate the live animation GameObject go; go = (GameObject)Instantiate(liveAnimationPrefab, Vector3.zero, Quaternion.identity); go.transform.parent = _thisTransform; _liveAnimation = go.GetComponent <BoneAnimation>(); // register the live animation's delegates _liveAnimation.RegisterUserTriggerDelegate(LiveUserTrigger); _liveAnimation.RegisterColliderTriggerDelegate(LiveColliderTrigger); // start out dead State = STATE.Dead; }
/// <summary> /// Set up the pasta from the Pasta Manager /// </summary> /// <param name="manager">Reference to the game manager</param> public void Initialize(ROTD_GameManager manager) { // Set the state to initializing State = STATE.Initializing; // cache some references and perform calculations _gameManager = manager; _thisTransform = transform.transform; _trailTransform = trailParticles.transform; // instantiate the live animation GameObject go; go = (GameObject)Instantiate(liveAnimationPrefab, Vector3.zero, Quaternion.identity); go.transform.parent = _thisTransform; _liveAnimation = go.GetComponent<BoneAnimation>(); // register the live animation's delegates _liveAnimation.RegisterUserTriggerDelegate(LiveUserTrigger); _liveAnimation.RegisterColliderTriggerDelegate(LiveColliderTrigger); // start out dead State = STATE.Dead; }