void Start() { scriptobj = GameObject.FindWithTag("scriptObj").transform; playerstate = scriptobj.GetComponent <playerStateLinster> (); playerstate.setToolState(0); player = GameObject.FindWithTag("Player").transform; }
void Start() { playerstate = GameObject.FindWithTag("scriptObj").GetComponent <playerStateLinster> (); _animation = GameObject.FindWithTag("Player").GetComponent <Animation> (); _animation.wrapMode = WrapMode.Once; AnimationState attack1_state = _animation["attack1"]; attack1_state.layer = 1; attack1_state.weight = 1; _animation ["hit"].layer = 1; _animation ["hit"].weight = 1; GameObject.FindWithTag("winpic").GetComponent <UISprite> ().enabled = false; GameObject.FindWithTag("losepic").GetComponent <UISprite> ().enabled = false; //attack1_state.enabled = true; }
void Awake() { moveDirection = transform.TransformDirection(Vector3.forward); playerstate = GameObject.FindWithTag("scriptObj").GetComponent <playerStateLinster> (); playerstate.setAniState(0); _animation = GetComponent <Animation>(); if (!_animation) { Debug.Log("The character you would like to control doesn't have animations. Moving her might look weird."); } /* * public var idleAnimation : AnimationClip; * public var walkAnimation : AnimationClip; * public var runAnimation : AnimationClip; * public var jumpPoseAnimation : AnimationClip; */ if (!idleAnimation) { _animation = null; Debug.Log("No idle animation found. Turning off animations."); } if (!walkAnimation) { _animation = null; Debug.Log("No walk animation found. Turning off animations."); } if (!runAnimation) { _animation = null; Debug.Log("No run animation found. Turning off animations."); } if (!jumpPoseAnimation && canJump) { _animation = null; Debug.Log("No jump animation found and the character has canJump enabled. Turning off animations."); } }
void Start() { this.bar.SetRect(-75, -7, curXue, height); state = GameObject.FindWithTag("scriptObj").GetComponent <playerStateLinster> (); }