Exemplo n.º 1
0
    void reSpawnPlayerAt(Transform sTransform, InstantiationEnum type)
    {
        EnumInstantiation instantiationObject = SceneMode.instance.getInstantiationByEnum(type);
        Transform         instantiation       = instantiationObject.iTransform;

        cPlayer = Instantiate(instantiation, sTransform.position, sTransform.rotation);

        cameraManager.target = cPlayer;
        playerController.setTarget(cPlayer);
    }
    public Transform instantiate(InstantiationEnum inputEnum)
    {
        EnumInstantiation instantiationObject = SceneMode.instance.getInstantiationByEnum(inputEnum);
        Transform         instantiation       = instantiationObject.iTransform;
        Transform         transform           = transformMapping[inputEnum].iTransform;

        if (transformMapping.ContainsKey(inputEnum) && instantiation != null)
        {
            return(Instantiate(instantiation, transform.position, transform.rotation));
        }

        return(null);
    }