Exemple #1
0
    // Use this for initialization
    void Start()
    {
        _rigidbody  = GetComponent <Rigidbody>();
        _controller = GetComponent <QuerySDMecanimController>();

        _origPosition = _rigidbody.position;
    }
Exemple #2
0
    void ChooseRandomCheerleader( )
    {
        foreach (var cheerleaderP in SQuerySDMecanimControllers)
        {
            cheerleaderP.gameObject.SetActive(false);
        }
        QuerySDMecanimController cheerleader1 = SQuerySDMecanimControllers.GetRandomElement();
        QuerySDMecanimController cheerleader2 = SQuerySDMecanimControllers.GetRandomElement();

        while (cheerleader1.gameObject.name == cheerleader2.gameObject.name)
        {
            cheerleader2 = SQuerySDMecanimControllers.GetRandomElement();
        }
        bool cheerleader1IsOnPositivePosition = Random.Range(0, 2) == 0;

        if (cheerleader1IsOnPositivePosition)
        {
            cheerleader1.gameObject.transform.localPosition = new Vector3(2, 0, 0);
            cheerleader2.gameObject.transform.localPosition = new Vector3(-2, 0, 0);
        }
        else
        {
            cheerleader1.gameObject.transform.localPosition = new Vector3(-2, 0, 0);
            cheerleader2.gameObject.transform.localPosition = new Vector3(2, 0, 0);
        }
        cheerleader1.gameObject.SetActive(true);
        cheerleader2.gameObject.SetActive(true);
        ChangeAnimation(CheerState.Normal);
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        m_InitState = new Initialize(this);
        m_MoveState = new Move(this);
        m_IdleState = new Idle(this);

        m_MecanimController = gameObject.GetComponent <QuerySDMecanimController>();

        m_CameraPosition   = Camera.main.transform.position;
        m_CameraPosition.y = 20.5f;
        m_Target           = m_CameraPosition;

        SetState(m_MoveState);
    }
Exemple #4
0
 void Start()
 {
     mainCamera = GetComponent <Camera>();
     startTime  = Time.time;
     anim       = princess.GetComponent <QuerySDMecanimController>();
 }
Exemple #5
0
 void Start()
 {
     m_CharacterController = GetComponent <CharacterController>();
     m_MecanimController   = GetComponent <QuerySDMecanimController>();
 }