public void SpawnGiftElement(Vector3 position, ScenarioActionGiftConfig config, SpawnableVersion version) { foreach (SpawnablePrefabs prefab in this.giftPrefabs) { if (prefab.version == version) { Instantiate(prefab.prefab, position, Quaternion.identity, cardContainer).GetComponent <GiftConfigSpawnable>().giftConfig = config; } } }
public void Start() { giftConfig = GetComponent <ScenarioActionGiftConfig>(); openNodeScenarioAction = GetComponent <OpenNodeScenarioAction>(); if (giftConfig != null) { initialTargets = giftConfig.nodes; } else if (openNodeScenarioAction != null) { initialTargets = new ScenarioNode[] { openNodeScenarioAction.node }; } }
void Start() { giftConfig = GetComponent <ScenarioActionGiftConfig>(); giftConfig.listNodesDelegate += AddNodesToGift; }
private void Start() { gift = GetComponentInChildren <ScenarioActionGiftConfig>(); cond = GetComponentInParent <ScenarioCondition>(); cond.onConditionSuccess += SpawnGift; }