private GameManager gameManager;                            // Game manager reference
    #endregion

    #region Main Methods
    public void AwakeBehaviour()
    {
        // Get references
        gameManager = GameManager.Instance;
        if (GameObject.Find("InterfaceManager"))
        {
            interfaceManager = GameObject.Find("InterfaceManager").GetComponent <InterfaceManager>();
        }
        screenDistortion = Camera.main.GetComponent <ScreenDistortion>();
        cameraLogic      = Camera.main.GetComponent <CameraLogic>();

        // Initialize values
        canTransform         = true;
        transform.localScale = Vector3.Lerp(tankScale, bulletScale, 1f);

        // Set start material values
        for (int i = 0; i < tankRenderer.Length; i++)
        {
            tankRenderer[i].material.SetFloat(attributeName, 1.1f);
        }
        for (int i = 0; i < bulletRenderer.Length; i++)
        {
            bulletRenderer[i].material.SetFloat(attributeName, -0.1f);
        }
        for (int i = 0; i < tankRenderer.Length; i++)
        {
            tankRenderer[i].enabled = false;
        }

        for (int i = 0; i < tankObjs.Length; i++)
        {
            tankObjs[i].SetActive(false);
        }
    }
Example #2
0
    void Start()
    {
        if (difficulty == "Hard")
        {
            maxRange = 11;
        }
        else
        {
            difficulty = "Normal";
            maxRange   = 3;
        }

        mainCamera   = GameObject.Find("Main Camera");
        cameraScript = mainCamera.GetComponent <CameraLogic>();


        for (int i = 0; i < 2; i++)
        {
            // GameObject child = new GameObject("Player");
            cam      = Camera.main;
            startpos = gameObject.transform.position.x;
            Vector3 cameraOffset = new Vector3(cameraScript.speed, 0, 0);
            child.transform.parent = gameObject.transform;
            audioSources[i]        = child.AddComponent <AudioSource>();
        }

        nextEventTime = AudioSettings.dspTime + 2.0f;
        Debug.Log("Scheduled start at time " + nextEventTime);
        running = true;
    }
Example #3
0
    // Find reference to the main camera and the player character.
    void Awake()
    {
        try
        {
            mainCamera    = GameObject.FindGameObjectWithTag("MainCamera");
            _camera       = mainCamera.GetComponent <Camera>();
            cameraLogic   = mainCamera.GetComponent <CameraLogic>();
            boxCollider2D = gameObject.GetComponent <BoxCollider2D>();
        }
        catch
        {
            Debug.LogError("Cannot find gameobject with tag 'MainCamera'");
            Debug.Break();
            //UnityEditor.EditorApplication.isPlaying = false;
        }

        player = GameObject.FindGameObjectWithTag("Player");

        if (player == null)
        {
            Debug.LogError("Cannot find gameobject with tag 'Player'");
            Debug.Break();
            //UnityEditor.EditorApplication.isPlaying = false;
        }
    }
Example #4
0
    protected GameManager gameManager;          // Game manager reference
    #endregion

    #region Main Methods
    public virtual void AwakeBehaviour(CameraLogic cameraLogic)
    {
        // Get references
        gameManager = GameManager.Instance;

        // Initialize values
        health           = MaxHealth;
        stamina          = MaxStamina;
        timeScale        = 1f;
        desiredTimeScale = timeScale;
        canRecover       = true;
        canInteract      = true;

        if (useRagdoll)
        {
            // Search all rigidbodies in skeleton game object childs
            Rigidbody[] tempRbs = skeletonRoot.GetComponentsInChildren <Rigidbody>();

            // Initialize ragdoll rigidbodies lists
            ragdollRbs = new List <Rigidbody>();

            for (int i = 0; i < tempRbs.Length; i++)
            {
                if (tempRbs[i].gameObject.layer == LayerMask.NameToLayer("Shatters"))
                {
                    ragdollRbs.Add(tempRbs[i]);
                }
            }

            // Disable all ragdoll rigidbodies
            for (int i = 0; i < ragdollRbs.Count; i++)
            {
                ragdollRbs[i].isKinematic = true;
            }
        }

        // Awake character movement
        if (handleMovement)
        {
            movement.AwakeBehaviour();
        }

        if (handleFeedback)
        {
            feedback.AwakeBehaviour();
        }

        // Awake character actions
        if (actions)
        {
            actions.AwakeBehaviour();
        }

        // Awake all character combats
        for (int i = 0; i < combats.Length; i++)
        {
            combats[i].AwakeBehaviour(cameraLogic);
        }
    }
Example #5
0
    private RaycastHit hit;                     // Align raycast hit reference
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic cameraLogic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(cameraLogic);

        // Enable start dissolver event
        feedback.EnableEvent(2);
    }
Example #6
0
    private float temporalCounter;                              // Temporal time counter
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic cameraLogic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(cameraLogic);

        // Initialize values
        targets      = new List <Character>();
        initPosition = trans.position;
    }
Example #7
0
 void Start()
 {
     sceneCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraLogic>();
     Physics2D.IgnoreLayerCollision(9, 10, false);
     Physics2D.IgnoreLayerCollision(10, 11, false);
     health     = GameManager.instance.p_HP;
     jumpForce  = GameManager.instance.p_Jump;
     speed      = GameManager.instance.p_Speed;
     weaponType = 1;
 }
    // Use this for initialization
    void Start()
    {
        cinematicCamera = GetComponentInChildren <Camera>(true).gameObject;
        cinematicCamera.SetActive(false);

        mainCamera      = Camera.main.gameObject;
        mainCameraLogic = mainCamera.GetComponent <CameraLogic>();

        player         = GameObject.FindGameObjectWithTag("Player");
        playerMovement = player.GetComponent <PlayerMovement>();
    }
        public async Task <IActionResult> ChangeWorkingStatus([FromBody] int cameraId)
        {
            string      userGuid    = HttpContext.Request.Headers["UserGuid"];
            CameraLogic cameraLogic = new CameraLogic();

            if (!await cameraLogic.ChangeWorkingStatus(cameraId, userGuid))
            {
                return(BadRequest(cameraLogic.Response.ErrorMessage));
            }
            return(Ok("Success"));
        }
Example #10
0
        public async Task <IActionResult> GetCameraIdByLocation([FromQuery] double latitude, double longitude)
        {
            CameraLogic cameraLogic = new CameraLogic();
            int         cameraId    = await cameraLogic.GetCameraIdByLocation(latitude, longitude);

            if (cameraId == 0)
            {
                return(BadRequest(cameraLogic.Response.ErrorMessage));
            }
            return(Ok(cameraId));
        }
Example #11
0
        public async Task <IActionResult> UpdateCamera([FromBody] UpdateCameraRequest request)
        {
            string      userGuid    = HttpContext.Request.Headers["UserGuid"];
            CameraLogic cameraLogic = new CameraLogic();
            await cameraLogic.UpdateCamera(request, userGuid);

            if (!cameraLogic.Response.IsSuccessful)
            {
                return(BadRequest(cameraLogic.Response.ErrorMessage));
            }
            return(Ok("Success"));
        }
Example #12
0
        public async Task <IActionResult> GetCameras()
        {
            string        userGuid    = HttpContext.Request.Headers["UserGuid"];
            CameraLogic   cameraLogic = new CameraLogic();
            List <Camera> cameras     = await cameraLogic.GetAllUserCameras(userGuid);

            if (cameras == null)
            {
                return(Ok(new List <Camera>()));
            }
            return(Ok(cameras));
        }
Example #13
0
        public async Task <IActionResult> DeleteCamera([FromBody] Camera request)
        {
            string      userGuid    = HttpContext.Request.Headers["UserGuid"];
            CameraLogic cameraLogic = new CameraLogic();
            await cameraLogic.DeleteCamera(request, userGuid);

            if (!cameraLogic.Response.IsSuccessful)
            {
                return(BadRequest(cameraLogic.Response.ErrorMessage));
            }
            return(Ok(JsonConvert.SerializeObject("success")));
        }
Example #14
0
        public MapRenderer() : base()
        {
            _logics = new BaseLogic <MapControl>[]
            {
                new PinLogic(),
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new TileLayerLogic(),
            };

            _cameraLogic = new CameraLogic();
        }
Example #15
0
        public MapRenderer() : base()
        {
            _cameraLogic = new CameraLogic(UpdateVisibleRegion);

            AutoPackage = false;
            _logics     = new BaseLogic <GoogleMap>[]
            {
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new PinLogic(OnMarkerCreating, OnMarkerCreated, OnMarkerDeleting, OnMarkerDeleted),
                new TileLayerLogic(),
                new GroundOverlayLogic()
            };
        }
Example #16
0
 public MapRenderer()
 {
     _logics = new BaseLogic <MapView>[]
     {
         new PolylineLogic(),
         new PolygonLogic(),
         new CircleLogic(),
         new PinLogic(Config.ImageFactory),
         new GroundOverlayLogic(Config.ImageFactory)
     };
     _clusterLogic = new ClusterLogic(Config.ImageFactory);
     _cameraLogic  = new CameraLogic(() =>
     {
         OnCameraPositionChanged(NativeMap.Camera);
     });
 }
        public MapRenderer(Context context) : base(context)
        {
            _cameraLogic = new CameraLogic(UpdateVisibleRegion);

            AutoPackage = false;
            Logics      = new List <BaseLogic <GoogleMap> >
            {
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new PinLogic(context, Config.BitmapDescriptorFactory,
                             OnMarkerCreating, OnMarkerCreated, OnMarkerDeleting, OnMarkerDeleted),
                new TileLayerLogic(),
                new GroundOverlayLogic(context, Config.BitmapDescriptorFactory)
            };
        }
Example #18
0
        public MapRenderer(Context context) : base(context)
        {
            _cameraLogic  = new CameraLogic(UpdateVisibleRegion);
            _clusterLogic = new ClusterLogic(context, Config.BitmapDescriptorFactory);

            AutoPackage = false;
            _logics     = new BaseLogic <Android.Gms.Maps.GoogleMap>[]
            {
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new PinLogic(context, Config.BitmapDescriptorFactory),
                new GroundOverlayLogic(context, Config.BitmapDescriptorFactory)
                //new ClusterLogic(context, Config.BitmapDescriptorFactory)
            };
        }
Example #19
0
        public MapRenderer()
        {
            _logics = new BaseLogic <MapView>[]
            {
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new PinLogic(),
                new TileLayerLogic(),
                new GroundOverlayLogic()
            };

            _cameraLogic = new CameraLogic(() =>
            {
                OnCameraPositionChanged(NativeMap.Camera);
            });
        }
Example #20
0
        public MapRenderer()
        {
            _logics = new BaseLogic <MapView>[]
            {
                new PolylineLogic(),
                new PolygonLogic(),
                new CircleLogic(),
                new PinLogic(Config.ImageFactory, OnMarkerCreating, OnMarkerCreated, OnMarkerDeleting, OnMarkerDeleted),
                new TileLayerLogic(),
                new GroundOverlayLogic(Config.ImageFactory)
            };

            _cameraLogic = new CameraLogic(() =>
            {
                OnCameraPositionChanged(NativeMap.Camera);
            });
        }
Example #21
0
    /* * * * * * * * * * * * * * * * *
     * DATA TO TRACK
     * * * * * * * * * * * * * * * * *
     * winner
     * NN_averagePoints
     * AI_averagePoints
     * NN_totalPoints
     * AI_totalPoints
     * * * * * * * * * * * * * * * * *
     * tyoe
     * points
     * player
     * * * * * * * * * * * * * * * * * */

    /// <summary>
    /// Intiialize the critical variables for the class.
    /// </summary>
    void Awake()
    {
        Application.targetFrameRate = 60;
        Time.timeScale = 1;

        _units = new List <Unit>(ConstHolder.MAX_AGENTS);

        _regions = new Dictionary <RegionOrder, Region>();

        _particles = new List <ParticleSystem>(ConstHolder.MAX_AGENTS);

        _camera           = Camera.main.GetComponent <CameraLogic>();
        _evolutionManager = GetComponent <EvolutionManager>();

        _testsRan           = 0;
        _checkForTransition = false;
        _transitionPanel.Initialize();
    }
Example #22
0
    protected GameManager gameManager;                          // Game manager reference
    #endregion

    #region Main Methods
    public virtual void AwakeBehaviour(CameraLogic logic)
    {
        // Get references
        gameManager = GameManager.Instance;

        // Initialize values
        cameraLogic  = logic;
        attackInputs = new bool[maxAttacks];
        canAttack    = true;
        canCombat    = true;
        targets      = new List <Character>();
        destroyables = new List <Destroyable>();

        // Check for dangerous values
        if (damageTimer == 0f)
        {
            Debug.LogError("CharacterCombat: damageTimer value is " + damageTimer);
        }
    }
Example #23
0
    private List <Boss> bosses;                                                                                 // Boss target references list
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic logic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(logic);

        #if TANK_PICK
        pickObjects = new List <Transform>();
        #else
        isPicking = false;
        #endif

        // Initialize values
        bosses = new List <Boss>();

        // Awake tank explosion behaviour
        for (int i = 0; i < tankExplosion.Length; i++)
        {
            tankExplosion[i].AwakeBehaviour();
        }
    }
Example #24
0
    private Material[] dashDistortionsMats;             // Dash distortion trail renderer materials
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic logic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(logic);

        // Initialize values
        startFov            = logic.Cam.fieldOfView;
        dashTrailsMats      = new Material[dashTrails.Length];
        dashDistortionsMats = new Material[dashDistortions.Length];

        for (int i = 0; i < dashTrailsMats.Length; i++)
        {
            dashTrailsMats[i] = dashTrails[i].material;
        }
        for (int i = 0; i < dashDistortionsMats.Length; i++)
        {
            dashDistortionsMats[i] = dashDistortions[i].material;
        }

        // Initialize materials values
        for (int i = 0; i < dashTrailsMats.Length; i++)
        {
            dashTrailsMats[i].SetColor("_TintColor", new Color(1f, 1f, 0f, dashAlpha));
        }
        for (int i = 0; i < dashDistortionsMats.Length; i++)
        {
            dashDistortionsMats[i].SetFloat("_BumpAmt", dashDistortion);
            dashDistortions[i].enabled = false;
        }

        // Initialize aim values
        if (character.IsPlayer)
        {
            aimInitScale         = aimDamage.localScale;
            aimDamage.localScale = Vector3.one * 0.001f;
                #if BULLET_TIME
            aimTime.localScale = Vector3.one * 0.001f;
                #endif
            aimCounter = aimDuration + 1f;
        }
    }
    private bool canPlay;                               // Player can play state
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic cameraLogic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(cameraLogic);

        // Awake player transformation
        transformation.AwakeBehaviour();

        // Get references
        cameraTrans = cameraLogic.transform;

        // Initialize values
        slots      = maxSlots;
        isGrounded = true;
        canPlay    = true;

        // Load player position and rotation from game manager if needed
        if (savedPosition && SceneManager.GetActiveScene().name != "demo")
        {
            trans.position = gameManager.PlayerPosition;
            trans.rotation = Quaternion.Euler(gameManager.PlayerRotation);
        }
    }
Example #26
0
 private void Start()
 {
     m_animators   = FindObjectsOfType <Animator>();
     m_cameraLogic = GetComponent <CameraLogic>();
 }
Example #27
0
 void Start()
 {
     cameraLogic = Camera.main.GetComponent<CameraLogic> ();
     uiLogic = canvas.GetComponent<UILogic> ();
     setCarAndCarLogic ();
 }
Example #28
0
 void Awake()
 {
     camLogic = this;
 }
Example #29
0
 void Start()
 {
     cameraLogic = Camera.main.GetComponent<CameraLogic> ();
     menuScreen();
 }
Example #30
0
 void Awake()
 {
     camLogic = this;
 }
Example #31
0
    private float currentDistance;                              // Current nearest enemy distance
    #endregion

    #region Main Methods
    public override void AwakeBehaviour(CameraLogic logic)
    {
        // Call base class Awake method
        base.AwakeBehaviour(cameraLogic);
    }
Example #32
0
 private void Awake()
 {
     thisCam          = gameObject.GetComponent <Camera>();
     _instance_camera = this;
 }
Example #33
0
 void Awake()
 {
     instance = this;
 }