Exemple #1
0
        protected internal override void OnShow(object userdata)
        {
            base.OnShow(userdata);
            m_data = userdata as StructureData;

            CachedTransform.position += new Vector3(0, 20, 0);

            RaycastHit hitResult;

            if (Physics.Raycast(CachedTransform.position, Vector3.down, out hitResult))
            {
                lockPos = hitResult.point;
            }
            CachedTransform.position = lockPos;

            GameObject gb = GameEntry.Entity.GetEntity(Id).Handle as GameObject;

            if (gb)
            {
                m_originalTex = gb.GetComponent <MeshRenderer>().material.mainTexture;
            }
        }
Exemple #2
0
 public static void ShowStructure(this EntityComponent entityComponent, StructureData data)
 {
     entityComponent.ShowEntity(typeof(Structure), "Structure", data);
 }