Beispiel #1
0
    void Start()
    {
        GameObject playerChar = FindObjectOfType <SplineFollow>().gameObject;

        SplineFollow = playerChar.GetComponent <SplineFollow>();
        ShieldCheck  = playerChar.GetComponentInChildren <ItemController>();
        AvatarController playerCon = playerChar.GetComponentInChildren <AvatarController>();

        if (playerCon != null)
        {
            playerFeet[0] = playerCon.GetBoneTransform(playerCon.GetBoneIndexByJoint(KinectInterop.JointType.AnkleLeft, false));
            playerFeet[1] = playerCon.GetBoneTransform(playerCon.GetBoneIndexByJoint(KinectInterop.JointType.AnkleRight, false));
            playerIndex   = playerCon.playerIndex;
        }

        if (ProximityPoint == null)
        {
            ProximityPoint = gameObject.transform;
        }

        if (enemyToKill != null)
        {
            enemyToKill.GetComponent <EnemyDestroyed>().EnemyDestroyedEvent += EnemyKilled;
        }

        Debug.Assert(SplineFollow != null && ShieldCheck != null && playerCon != null,
                     "A necessary component (Spline Follow, Item Controller, Avatar Controller) is null!");
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     m_SplineFollow = new SplineFollow(m_Spline);
     m_SplineFollow.setDirection(m_TravelForwards);
     m_SplineFollow.setReverse(m_ReverseSpline);
     transform.position = m_SplineFollow.getPos();
     m_MoveToPos        = transform.position;
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     if (genManager == null)
     {
         genManager = FindObjectOfType <GenManager>();
     }
     if (splineFollow == null)
     {
         splineFollow = FindObjectOfType <SplineFollow>();
     }
 }
Beispiel #4
0
 // Start is called before the first frame update
 void Start()
 {
     splineFollowCart = GameObject.Find("MineCart").GetComponent <SplineFollow>();
     splineFollowCam  = GameObject.Find("[CameraRig]").GetComponent <SplineFollow>();
 }