void Awake() { Defines.self = gameObject.GetComponent <Defines>(); GameObject go = new GameObject(); go.name = "emptyGO"; xa.emptyGO = go; go = new GameObject(); go.name = "emptyGO2"; xa.emptyGO2 = go; Lines.InitLines(); Runes.InitRunes(); Nodes.InitNodes(); Manas.InitMana(); }
void Update() { Lines.UpdateLines(); Manas.UpdateMana(); Runes.UpdateRunes(); Nodes.DisplayNodeDebug(); if (Input.GetKeyDown(KeyCode.T)) { if (Time.timeScale == 1) { Time.timeScale = 0.5f; } else if (Time.timeScale == 0.5f) { Time.timeScale = 0.1f; } else if (Time.timeScale == 0.1f) { Time.timeScale = 2f; } else if (Time.timeScale == 2) { Time.timeScale = 5f; } else if (Time.timeScale == 5) { Time.timeScale = 1f; } Debug.Log("TimeScale: " + Time.timeScale); } Lines.ClearTheDead(); Lines.PrintInfo(); }
private void Awake() { Instance = this; PoolManas(); }
public static void HandleRuneAction(Rune rune) { switch (rune.type) { case RuneTypes.RuneOfHarvest: if (Time.timeSinceLevelLoad >= (rune.timeSet + 5)) { rune.timeSet = Time.timeSinceLevelLoad; Nodes.Node n = rune.GetNodeForTag(NodeTags.SpawnPointNode); if (n != null) { if (n.mana == null) //If this node is clear, create mana on it. { Debug.Log("Spawned! Time: " + Time.timeSinceLevelLoad + ", TimeSet: " + rune.timeSet + ", delay: 5"); Manas.CreateMana(n, rune.manaType); } } } //Push mana Nodes.Node n1 = null; Nodes.Node n2 = null; n1 = rune.GetNodeForTag(NodeTags.SpawnPointNode); n2 = rune.GetNodeForTag(NodeTags.PassToNode); PushMana(n1, n2); break; case RuneTypes.RuneOfMomentum: //Push mana PushMana(rune.GetNodeForTag(NodeTags.ConveyanceNode1), rune.GetNodeForTag(NodeTags.CenterNode)); PushMana(rune.GetNodeForTag(NodeTags.CenterNode), rune.GetNodeForTag(NodeTags.ConveyanceNode2)); PushMana(rune.GetNodeForTag(NodeTags.ConveyanceNode2), rune.GetNodeForTag(NodeTags.ConveyanceNode3)); PushMana(rune.GetNodeForTag(NodeTags.ConveyanceNode3), rune.GetNodeForTag(NodeTags.ConveyanceNode4)); PushMana(rune.GetNodeForTag(NodeTags.ConveyanceNode4), rune.GetNodeForTag(NodeTags.ConveyanceNode5)); PushMana(rune.GetNodeForTag(NodeTags.ConveyanceNode5), rune.GetNodeForTag(NodeTags.ConveyanceNode6)); //Is there mana on me? /* * nodeIndex = Nodes.GetIndexForNodePos(positionsOfInterest[0]); * if (nodeIndex != -1)//If this node exists (it probably does, it has lines on it) * { * if (Nodes.nodes[nodeIndex].mana != null) * { * Nodes.nodes[nodeIndex].mana.momentum = 2; * } * } * nodeIndex = Nodes.GetIndexForNodePos(positionsOfInterest[1]); * if (nodeIndex != -1)//If this node exists (it probably does, it has lines on it) * { * if (Nodes.nodes[nodeIndex].mana != null) * { * Nodes.nodes[nodeIndex].mana.momentum = 2; * } * }*/ break; } }
void Start() { Manas.RegisterMana(this.gameObject); }