コード例 #1
0
    public override void CreateChildren()
    {
        Debug.Log("Setting Up the Magic Chamber!");

        // First the focus
        Focus newFocus = Instantiate(focusPrefab).GetComponent <Focus>();

        newFocus.transform.SetParent(gameObject.transform, false);
        newFocus.name = "Focus";
        newFocus.SetParent(this);
        children.Add(newFocus);
        SetFocus(newFocus);

        // Then the condensers
        Collectors newCollectors = Instantiate(collectorsPrefab).GetComponent <Collectors>();

        newCollectors.transform.SetParent(gameObject.transform, false);
        newCollectors.name = "Collectors";
        newCollectors.SetParent(this);
        children.Add(newCollectors);
        newCollectors.CreateChildren();

        // Then the crystals
        Crystals newCrystals = Instantiate(crystalsPrefab).GetComponent <Crystals>();

        newCrystals.transform.SetParent(gameObject.transform, false);
        newCrystals.name = "Crystals";
        newCrystals.SetParent(this);
        children.Add(newCrystals);
        newCrystals.CreateChildren();

        // Then the altars
    }