Inheritance: MonoBehaviour, IObserver
Exemplo n.º 1
0
 void Awake()
 {
     PlayerCollider    = new PlayerCollider(this);
     PlayerFoot        = GetComponentInChildren <PlayerFoot>();
     PlayerHead        = GetComponentInChildren <PlayerHead>();
     PlayerRigidbody2D = GetComponent <Rigidbody2D>();
 }
 void Awake()
 {
     _instance = this;
     rigi      = GetComponent <Rigidbody2D>();
     foot      = transform.Find("Foot").GetComponent <PlayerFoot>();
     foot.SetTagsLayer(tagList, layer);
 }
Exemplo n.º 3
0
        private void InitFeet()
        {
            leftFootData  = new LeftFootData(() => GetLeftFootPosition(), () => GetLeftFootRotation() /*GetLeftFootRotation()*/);
            rightFootData = new RightFootData(() => GetRightFootPosition(), () => GetRightFootRotation() /*GetRightFootRotation()*/);
            hipData       = new HipData(() => GetCenterPosition(), () => GetCenterRotation());
            leftHandData  = new LeftHandData(() => GetLeftHandPosition(), () => GetLeftHandRotation());
            rightHandData = new RightHandData(() => GetRightHandPosition(), () => GetRightHandRotation());

            UnityModelDataManager mdm = GetComponent <UnityModelDataManager>();

            mdm.AddProvider(leftFootData);
            mdm.AddProvider(rightFootData);
            mdm.AddProvider(hipData);
            mdm.AddProvider(leftHandData);
            mdm.AddProvider(rightHandData);

            leftFoot  = Instantiate(playerFootPrefab);
            rightFoot = Instantiate(playerFootPrefab);

            if (useLineRenderers)
            {
                leftFoot.InitLineRenderer(Color.red);
                rightFoot.InitLineRenderer(Color.blue);
            }
        }
Exemplo n.º 4
0
    void Start()
    {
        rigid2d = GetComponent <Rigidbody2D>();
        foot    = GetComponentInChildren <PlayerFoot>();
        anim    = GetComponentInChildren <Animator>();

        keyCodeNow      = 0;
        keyImage.sprite = key[keyCodeNow];
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     sr   = GetComponent <SpriteRenderer>();
     rb2d = GetComponent <Rigidbody2D>();
     pd   = GetComponent <PlayerData>();
     foot = GetComponentInChildren <PlayerFoot>();
     pd.SetAll(GameController.activatingPlayer);
     pd.SetVariedData(GameController.activatingPlayer);
 }
Exemplo n.º 6
0
 private void Awake()
 {
     GameObject L = GameObject.Find("toe_left");
     GameObject R = GameObject.Find("toe_right");
     if (L != null)
     {
         foot_L = L.GetComponent<PlayerFoot>();
     }
     else {
         print("Left foot missing");
     }
     if (R != null)
     {
         foot_R = R.GetComponent<PlayerFoot>();
     }
     else
     {
         print("Right foot missing");
     }
 }
Exemplo n.º 7
0
    private void Awake()
    {
        PlayerManager.player_aud_source = transform.GetComponent <AudioSource>();
        GameObject L = GameObject.Find("toe_left");
        GameObject R = GameObject.Find("toe_right");

        if (L != null)
        {
            foot_L = L.GetComponent <PlayerFoot>();
        }
        else
        {
            print("Left foot missing");
        }
        if (R != null)
        {
            foot_R = R.GetComponent <PlayerFoot>();
        }
        else
        {
            print("Right foot missing");
        }
    }