/// <summary> /// Listen InstancePrefab SendMessage and start logic /// </summary> public void OnInstancePrefab(InstancePrefab prefab) { inputMgr = prefab.instance.GetComponentInChildren<AIInput>(); if (inputMgr == null) { Debug.LogWarning("AIInput is expected in the prefab"); return; } inputMgr.SetY(-1); }
public void OnInstancePrefab(InstancePrefab prefab) { inputMgr = prefab.instance.GetComponentInChildren <AIInput>(); if (inputMgr == null) { Debug.LogWarning("AIInput is expected in the prefab"); return; } inputMgr.SetX(-1); }
/// <summary> /// Listen InstancePrefab SendMessage and start logic /// </summary> public void OnInstancePrefab(InstancePrefab prefab) { inputMgr = prefab.instance.GetComponentInChildren<AIInput>(); if (inputMgr == null) { Debug.LogWarning("AIInput is expected in the prefab"); return; } pc2d = prefab.instance.GetComponentInChildren<PlatformerCollider2D>(); inputMgr.SetX(1); pc2d.onLeftWall += OnLeftWall; pc2d.onRightWall += OnRightWall; }
public void OnInstancePrefab(InstancePrefab prefab) { inputMgr = prefab.instance.GetComponentInChildren<AIInput>(); if (inputMgr == null) { Debug.LogWarning("AIInput is expected in the prefab"); return; } pc2d = prefab.instance.GetComponentInChildren<PlatformerCollider2D>(); character = prefab.instance.GetComponentInChildren<Character>(); inputMgr.SetX(1); character.onAreaChange += OnAreaChange; pc2d.onLeftWall += OnLeftWall; pc2d.onRightWall += OnRightWall; }