Пример #1
0
 private void Start()
 {
     Animator       = GetComponent <Animator>();
     Animation      = GetComponent <Animation>();
     SpriteRenderer = GetComponent <SpriteRenderer>();
     MoveChar       = GetComponent <MoveChar>();
 }
Пример #2
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     damage       = false;
     MoveChar     = GetComponent <MoveChar>();
     NumberHealth = 3;
     PrintHealth();
 }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        if (curCharacterController == null)
        {
            curCharacterController = GetComponent <CharacterController>();
        }

        if (curRB == null)
        {
            curRB = gameObject.GetComponent <Rigidbody>();
        }

        if (curWeapon == null)
        {
            GameObject go = GenerateWeapon();
            curWeapon = go.GetComponent <Weapon>();
        }

        //animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1);
        //animator.SetIKPosition(AvatarIKGoal.RightHand, weaponPosGO.position);

        // Find a reference to the ExampleStateMachineBehaviour in Start since it might not exist yet in Awake.
        idleSmb    = animator.GetBehaviour <IdleChar> ();
        moveSmb    = animator.GetBehaviour <MoveChar> ();
        jumpingSmb = animator.GetBehaviour <JumpingChar> ();
        fallSmb    = animator.GetBehaviour <FallChar> ();
        dashSmb    = animator.GetBehaviour <DashChar> ();
        deadSmb    = animator.GetBehaviour <DeadChar> ();

        // Set the StateMachineBehaviour's reference to an ExampleMonoBehaviour to this.
        idleSmb.charMB    = this;
        moveSmb.charMB    = this;
        jumpingSmb.charMB = this;
        fallSmb.charMB    = this;
        dashSmb.charMB    = this;
        deadSmb.charMB    = this;

        if (inputData != null)
        {
            inputData.InitInputs();
        }

        curCamCtrl.allowMovement = true;
    }
Пример #4
0
    void Start()
    {
        baseInit();
        var child = transform.Find("SkeletonOutlaw_Armor").gameObject;

        _Animation = child.transform.GetComponent <Animator>();
        _mC        = gameObject.AddComponent <MoveChar>();

        string playidle = "SkeletonOutlaw@Idle{0}" + Random.Range(0, 3).ToString("00");

        _Animation.SetFloat("speed", 0.0f);

        RaycastHit hit;

        if (Physics.Raycast(transform.position, Vector3.down * 100, out hit, m_RayMaskLayer) == true)
        {
            this.transform.position = hit.point;
        }
        colorindex++;
    }
Пример #5
0
 void Start()
 {
     moveChar = GameObject.FindGameObjectWithTag("Player").GetComponent<MoveChar>();
     if(!back)
         back = GameObject.Find("IniMovement");
     if(!actual)
         actual = GameObject.Find("MovedMovement");
 }
Пример #6
0
	public void OnTriggerEnter(Collider other)
	{	
		if(other.tag == "Player")
		{
			StartCutScene = true;
            Player = other.gameObject;
            animator = Player.GetComponent<Animator>();
            MoveChar = Player.GetComponent<MoveChar>();

            MoveChar.PodeMover = false;

            Plasma.transform.position = Player.transform.position;
            Plasma.SetActive(true);
        }		
	}