コード例 #1
0
    internal SandboxObjectReference NewChildSandboxObject(SandboxObjectReferenceData childSandboxObjectData, Vector3 position)
    {
        SandboxObjectReference childSandboxObject = (SandboxObjectReference)editable.NewSandboxObjectReference(childSandboxObjectData);

        childSandboxObject.gameObject.transform.position = position;
        return(childSandboxObject);
    }
コード例 #2
0
    internal override void PopulateData(ModuleData moduleData)
    {
        _data = (SandboxObjectReferenceData)moduleData;
        SandboxObjectData sandboxObjectData = ModuleHead.GetSandboxObjectDataById(GameHead.instance.universeData, _data.id);

        SpawnNestedModules(sandboxObjectData);
        ApplyData();
    }
コード例 #3
0
ファイル: Editable.cs プロジェクト: ech0array/chunx
    internal Module NewSandboxObjectReference(SandboxObjectReferenceData sandboxObjectReferenceData)
    {
        GameObject             gameObject             = Instantiate(ModuleHead.instance.GetModulePrefab(typeof(SandboxObjectReferenceData)).gameObject, this.transform);
        SandboxObjectReference sandboxObjectReference = gameObject.GetComponent <SandboxObjectReference>();

        _idModuleMap.Add(sandboxObjectReferenceData.id, sandboxObjectReference);

        sandboxObjectReference.parent = this;
        sandboxObjectReference.PopulateData(sandboxObjectReferenceData);
        sandboxObjectReference.OnLoad();
        return(sandboxObjectReference);
    }
コード例 #4
0
 private bool HasChildRecursive(SandboxObjectData sandboxObjectData, int id)
 {
     for (int i = 0; i < sandboxObjectData.modules.Count; i++)
     {
         if (!(sandboxObjectData.modules[i] is SandboxObjectReferenceData))
         {
             continue;
         }
         SandboxObjectReferenceData childSandboxObjectData = (SandboxObjectReferenceData)sandboxObjectData.modules[i];
         int childId = childSandboxObjectData.id;
         if (childId == id)
         {
             return(true);
         }
         bool overflow = HasChildRecursive(ModuleHead.GetSandboxObjectDataById(GameHead.instance.universeData, childId), id);
         if (overflow)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #5
0
 public SandboxObjectReferenceData(SandboxObjectReferenceData sandboxObjectReferenceData)
 {
     id   = sandboxObjectReferenceData.id;
     name = sandboxObjectReferenceData.name;
 }