Example #1
0
 private void Create(ObjectForPlacementData data)
 {
     if (data is FigurineData)
     {
         Figurine figurine = Figurine.Create(prefabFigurine, content, data as FigurineData) as Figurine;
         CreateFigurine?.Invoke(figurine);
     }
     else if (data is SubjectData)
     {
         Subject subject = Subject.Create(prefabSubject, content, data as SubjectData) as Subject;
         CreateSubject?.Invoke(subject);
     }
 }
    /// <param name="parent">Default use own parent</param>
    public void Create(ObjectForPlacementData data, RectTransform parent = null)
    {
        if (parent == null)
        {
            parent = content;
        }

        if (data is FigurineData)
        {
            Figurine figurine = Figurine.Create(prefabFigurine, parent, data as FigurineData) as Figurine;
            figurine.name = indefecator;
            CreateFigurine?.Invoke(figurine);
        }
        else if (data is SubjectData)
        {
            Subject subject = Subject.Create(prefabSubject, parent, data as SubjectData) as Subject;
            subject.name = indefecator;
            CreateSubject?.Invoke(subject);
        }
    }