void revertSpeedAI() { GameObject ai = GameObject.FindGameObjectWithTag("AI"); NodeFollow boost = ai.GetComponent <NodeFollow>(); boost.speed = boost.Ospeed; }
private NodeFollowAction action; // Reference to the Node Follow Action #endregion void Start() { #region Get components nodeFollow = gameObject.GetComponent <NodeFollow>(); action = gameObject.GetComponent <NodeFollowAction>(); #endregion }
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 }
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>(); }
// 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(); }
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 }