コード例 #1
0
    public SacredIcon SpawnSacredIcon()
    {
        SacredIcon newSacredIcon;
        Vector3    newIconPos          = new Vector3(Random.Range(lowerLeftBound.x, upperRightBound.x), Random.Range(lowerLeftBound.y, upperRightBound.y), 0);
        GameObject newSacredIconObject = Instantiate(Data.instance.SacredIconPrefab(), newIconPos, Quaternion.identity, objectsContainer);

        newSacredIcon = newSacredIconObject.GetComponent <SacredIcon>();
        Deity newDeity = new Deity();

        newDeity.Generate();
        newSacredIcon.Setup(newDeity);
        sacredIcons.Add(newSacredIcon);
        Playable newPlayable = newSacredIconObject.GetComponent <Playable>();

        if (newPlayable != null)
        {
            playableObjects.Add(newPlayable);
        }
        return(newSacredIcon);
    }