Exemple #1
0
    void Start()
    {
        //start by getting needed component references
        m_GotoComponent = gameObject.GetComponent <GotoObject>();
        m_eBehType      = gameObject.GetComponent <FlrMain>().FlrBehType;

        //if not set to normal behaviour
        if (m_eBehType != FlrMain.FlrBehaviourType.Normal)
        {
            //switch off automatic movement
            m_GotoComponent.AutoMove = false;
            //start the overall coroutine with the sub-coroutine to be called
            switch (m_eBehType)
            {
            case FlrMain.FlrBehaviourType.Offset:
                StartCoroutine("Movement", "OffsetMove");
                break;

            case FlrMain.FlrBehaviourType.RandSpeed:
                StartCoroutine("Movement", "RandMove");
                break;

            case FlrMain.FlrBehaviourType.Wavey:
                StartCoroutine("Movement", "SineMove");
                break;
            }
        }
    }
    void Start()
    {
        //start by getting needed component references
        m_GotoComponent = gameObject.GetComponent<GotoObject>();
        m_eBehType = gameObject.GetComponent<FlrMain>().FlrBehType;

        //if not set to normal behaviour
        if (m_eBehType != FlrMain.FlrBehaviourType.Normal)
        {
            //switch off automatic movement
            m_GotoComponent.AutoMove = false;
            //start the overall coroutine with the sub-coroutine to be called
            switch (m_eBehType)
            {
                case FlrMain.FlrBehaviourType.Offset:
                    StartCoroutine("Movement", "OffsetMove");
                    break;

                case FlrMain.FlrBehaviourType.RandSpeed:
                    StartCoroutine("Movement", "RandMove");
                    break;

                case FlrMain.FlrBehaviourType.Wavey:
                    StartCoroutine("Movement", "SineMove");
                    break;
            }
        }
    }