Example #1
0
    // Use this for initialization
    void Start()
    {
        movablePlayer = GetComponent <MovablePlayer>();

        EventDelegateManager.instance.restartLevelDelegate += OnRestartLevel;
        EventDelegateManager.instance.playerDieDelegate    += OnDie;
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        m_gamepad  = GetComponent <HFTGamepad>();
        m_hftInput = GetComponent <HFTInput>();

        ikHandler = transform.Find("IkHandler");
        //sword = ikHandler.FindChild("SwordParent");
        sword = transform.Find("SwordParent");
        hand  = ikHandler.Find("Hand");



        int playerNdx = s_playerCount++;


        SetColor(m_gamepad.Color);


        // Delete ourselves if disconnected
        //m_gamepad.OnDisconnect += Remove;



        //cameraBaseRotation = Camera.main.transform.rotation * Quaternion.Euler(0f, -180f, 0f);


        //baseRotation = Quaternion.identity;
        //inverseBaseRotation = Quaternion.identity;
        //lastRotation = transform.rotation;



        // TEST: attach as child of player (horse)
        steering = false;
        //rope = sword.Find("Rope").gameObject;
        parentPlayer = GameObject.Find("Player");
        //transform.SetParent(parentPlayer.transform);
        //transform.position = parentPlayer.transform.FindChild("SwordCharacterPivot").position;
        movablePlayer = parentPlayer.GetComponent <MovablePlayer>();



        EventDelegateManager.instance.playerDieDelegate    += OnDie;
        EventDelegateManager.instance.restartLevelDelegate += OnRestartLevel;
    }