コード例 #1
0
    private void ChangeEntityBoundsCheckerStatus(DCL.Models.DecentralandEntity entity, bool isInsideBoundaries)
    {
        if (currentEntity.rootEntity.entityId != entity.entityId)
        {
            return;
        }

        nameInputField_Text.color = isInsideBoundaries ? entityInsideOdBoundsColor : entityOutOfBoundsColor;
    }
コード例 #2
0
    void Awake()
    {
        if (i != null)
        {
            Destroy(gameObject);
            return;
        }

        i = this;
        originalGravity = gravity;

        SubscribeToInput();
        CommonScriptableObjects.playerUnityPosition.Set(Vector3.zero);
        CommonScriptableObjects.playerWorldPosition.Set(Vector3.zero);
        CommonScriptableObjects.playerCoords.Set(Vector2Int.zero);
        CommonScriptableObjects.playerUnityEulerAngles.Set(Vector3.zero);

        characterPosition      = new DCLCharacterPosition();
        characterController    = GetComponent <CharacterController>();
        freeMovementController = GetComponent <FreeMovementController>();
        collider = GetComponent <Collider>();

        CommonScriptableObjects.worldOffset.OnChange          += OnWorldReposition;
        Environment.i.platform.debugController.OnDebugModeSet += () => supportsMovingPlatforms = true;

        lastPosition     = transform.position;
        transform.parent = null;

        CommonScriptableObjects.rendererState.OnChange += OnRenderingStateChanged;
        OnRenderingStateChanged(CommonScriptableObjects.rendererState.Get(), false);

        if (avatarGameObject == null || firstPersonCameraGameObject == null)
        {
            throw new System.Exception("Both the avatar and first person camera game objects must be set.");
        }

        avatarReference = new DCL.Models.DecentralandEntity {
            gameObject = avatarGameObject
        };
        firstPersonCameraReference = new DCL.Models.DecentralandEntity {
            gameObject = firstPersonCameraGameObject
        };
    }
コード例 #3
0
ファイル: DecentralandEntity.cs プロジェクト: menduz/explorer
        public void SetParent(DecentralandEntity entity)
        {
            if (parent != null)
            {
                parent.RemoveChild(this);
            }

            if (entity != null)
            {
                entity.AddChild(this);

                if (entity.gameObject && gameObject)
                {
                    gameObject.transform.SetParent(entity.gameObject.transform, false);
                }
            }
            else if (gameObject)
            {
                gameObject.transform.SetParent(null, false);
            }

            parent = entity;
        }