void Strike() { Debug.Log("STRIKE"); striking = true; strikeCount = 0f; if (parent) { Debug.Log("ParentStrike"); parent.Strike(); } line.startColor = ZapManager.Instance.strikeColor; line.endColor = ZapManager.Instance.strikeColor; }
void StrikeLine() { /* * strikeLine = gameObject.AddComponent<LineRenderer>(); * strikeLine.SetPosition(0, transform.position); * strikeLine.SetPosition(1, strikePartner.transform.position); * strikeLine.startColor = ZapManager.Instance.strikeColor; * strikeLine.endColor = ZapManager.Instance.strikeColor; */ GameObject prefab = ZapManager.Instance.nodePrefab; GameObject newNodeObj = Instantiate(prefab, transform.position, Quaternion.identity, transform); ZapNode newNode = newNodeObj.GetComponent <ZapNode>(); newNode.SetParent(strikePartner); newNode.Strike(); }