示例#1
0
        protected virtual PlayAreaBAnchor AddNewChildBAnchor(bool directlyStartPlacing = true)
        {
            if (IS_NOT_NULL(playAreaBAnchorPrefab) &&
                IS_NULL(CurrentPlayAreaBAnchorBeingPlaced))
            {
                PlayAreaBAnchor spawnedPlayAreaBAnchor = Instantiate(playAreaBAnchorPrefab);
                if (IS_NOT_NULL(spawnedPlayAreaBAnchor))
                {
                    spawnedPlayAreaBAnchor.transform.parent = transform;
                    PlayAreaBAnchors.Add(spawnedPlayAreaBAnchor);
                    LogConsole("Adding new play area BAnchor : " + PlayAreaBAnchors.Count);

                    spawnedPlayAreaBAnchor.StartedPlacing += On_SpawnedPlayAreaBAnchor_StartedPlacing;
                    spawnedPlayAreaBAnchor.EndedPlacing   += On_SpawnedPlayAreaBAnchor_EndedPlacing;

                    if (directlyStartPlacing)
                    {
                        spawnedPlayAreaBAnchor.OnStartPlacing();
                    }

                    return(spawnedPlayAreaBAnchor);
                }
            }
            return(null);
        }