Beispiel #1
0
    public void AddObject(InteractiveObject _object)
    {
        UID uid = new UID((int)_object.typeID, _object.id);
        InteractiveObject obj;

        if (idToObject.TryGetValue(uid, out obj))
        {
            if (obj.isDummy)
            {
                RemoveActorNoCheck(obj);
                _object.CopyFromDummy(obj);
                GameObject.Destroy(obj);
            }
            else
            {
                Debug.LogError("Failed to add object " + _object.name + " id = " + _object.id);
                return;
            }
        }
        //
        _object.gameStage = this;
        idToObject.Add(uid, _object);
        OnPositionChanged(_object);
    }