Пример #1
0
    //int m_Vitae = 0;        public int Vitae { get { return m_Vitae; } }
    #endregion

    // Use this for initialization
    public override void Start()
    {
        base.Start();

        m_PlayerManager       = ServiceLocator.Instance.GetService <PlayerManager>(ManagerType.PLAYER_MANAGER);
        m_CharacterController = GetComponent <CharacterController>();
        m_PlayerController    = GetComponent <PlayerController>();
        //m_Sprite = transform.Find("Sprite");

        visualFeedback = GetComponent <VisualFeedback>();

        // Init stats
        m_HP = m_Data.HP;
        m_Animator.SetInteger("HP", m_HP);

        UpdateMaxHP();
        UpdateMaxEnergy();

        m_Energy = m_MaxEnergy;

        m_JumpSpeed         = Physics.gravity.y;
        m_CurrentJumpHeight = m_Data.JumpHeight / 10f;

        m_CurrentSpeed         = m_Data.Speed;
        m_CurrentVerticalSpeed = m_Data.VerticalSpeed;

        m_PlayerManager.OnFusionComplete += ReportFusionComplete;

        m_readyForFusionFX = Instantiate(ReadyForFusionFX, transform);
        m_readyForFusionFX.SetActive(false);

        m_InvincibilityFX = Instantiate(InvincibilityFX, transform);
        m_InvincibilityFX.SetActive(false);

        if (m_InvertSprite)
        {
            m_SpriteRotation.y = 180f;
        }

        if (attack1 == null)
        {
            attack1 = Instantiate(m_FXAttack1);
        }
        if (attack2 == null)
        {
            attack2 = Instantiate(m_FXAttack2);
        }
        if (attack3 == null)
        {
            attack3 = Instantiate(m_FXAttack3);
        }
    }
Пример #2
0
 void Start()
 {
     // Debug.Log("GameflowManager: Start() - grabbing timer");
     // Get the class/behavioural components from their parent GameSystem objects
     timer = GameSystem.GetComponent <Timer>();
     VisualFeedbackScript = VisualFeedback.GetComponent <VisualFeedback>();
     saveManager          = GameSystem.GetComponent <SaveManager>();
     scoreManager         = GameSystem.GetComponent <ScoreManager>();
     targetManager        = TargetManager.GetComponent <TargetManager>();
     // start timer and set game state to RUNNING
     timer.StartTimer();
     state = StateType.RUNNING;
 }
Пример #3
0
    public override void Start()
    {
        //StartCoroutine(EnemyAttack());

        base.Start();

        if (m_DataList)
        {
            m_Data = m_DataList.GetDataFromType(m_Type);
        }

        m_AttackBox    = GetComponentInChildren <AttackBox>(true);
        m_CurrentSpeed = m_Data.Speed;

        m_EnemyManager.RegisterEnemy(this);

        if (attack1 == null)
        {
            attack1 = Instantiate(m_FXAttack1);
        }

        visualFeedback = GetComponent <VisualFeedback>();
    }