コード例 #1
0
    void revertSpeedAI()
    {
        GameObject ai    = GameObject.FindGameObjectWithTag("AI");
        NodeFollow boost = ai.GetComponent <NodeFollow>();

        boost.speed = boost.Ospeed;
    }
コード例 #2
0
    private NodeFollowAction action;    // Reference to the Node Follow Action
    #endregion

    void Start()
    {
        #region Get components
        nodeFollow = gameObject.GetComponent <NodeFollow>();
        action     = gameObject.GetComponent <NodeFollowAction>();
        #endregion
    }
コード例 #3
0
    void OnEnable()
    {
        #region The target for custom editor
        script = (NodeFollow)target;
        #endregion

        #region Node Follow Label Image
        nodeFollowLabel = Resources.Load("NodeFollow Label") as Texture2D;
        #endregion
    }
コード例 #4
0
    public float waitBeforeNewAction;       // Wait this amount before can do the some action again
    #endregion

    void Start()
    {
        if (targetGameObject == null)
        {
            Debug.LogError("Target gameObject for Node Follow script is not set");
            return;
        }
        // Getting the NodeFollow component in targetGameObject
        nodeFollow = targetGameObject.GetComponent <NodeFollow>();
    }
コード例 #5
0
    // Issues with AI speed boost implementation
    IEnumerator speedBoostAI()
    {
        GameObject ai    = GameObject.FindGameObjectWithTag("AI");
        NodeFollow boost = ai.GetComponent <NodeFollow>();

        boost.speed += 50;
        yield return(new WaitForSeconds(2));

        revertSpeedAI();
    }
コード例 #6
0
    public bool doingAction;                            // Is doing the action
    #endregion

    void Start()
    {
        #region Get component & null checks
        if (gameObject.GetComponent <NodeFollow>() != null)
        {
            nodeFollowScript = gameObject.GetComponent <NodeFollow>();
        }
        else
        {
            Debug.LogError("Gameobject has no NodeFollow");
            return;
        }
        if (nodeFollowScript.movingObject == null)
        {
            Debug.LogError("Moving object not set");
            return;
        }
        if (node > nodeFollowScript.nodes.Length || node <= 0)
        {
            Debug.LogError("Invalid node number");
            return;
        }
        #endregion
    }