protected override void Awake()
 {
     base.Awake();
     stageComponent = null;
     npcCreated     = false;
     sideToFace     = (facingRight ? BaseAnimator.SIDE_RIGHT : BaseAnimator.SIDE_LEFT);
 }
Exemple #2
0
 protected override void Awake()
 {
     base.Awake();
     fadeRequested  = false;
     fadeCompleted  = false;
     stageComponent = null;
 }
Exemple #3
0
 protected override void ClearTriggers()
 {
     triggerSourceComponent = null;
     triggerComponents      = null;
     triggeringComponents   = null;
     base.ClearTriggers();
 }
 protected override void AbandonInterests()
 {
     base.AbandonInterests();
     stageComponent = null;
     agentComponent = null;
     waypoints      = null;
 }
    public override void ExtractInterests(ChallengeStage stage)
    {
        ObstacleDatabase obstacleDatabase  = null;
        bool             extractionSuccess = false;

        base.ExtractInterests(stage);
        stageComponent = stage;
        if (stage != null)
        {
            obstacleDatabase = stage.GetObstacleDatabase();
            if (obstacleDatabase != null)
            {
                obstacleModel = obstacleDatabase.GetObstacleModel(obstacleCode);
                if ((obstacleModel != null) && stage.GetNodeStructurePosition(placementNodeID, ref obstaclePosition))
                {
                    obstaclePosition += offsetWithinNode;
                    extractionSuccess = true;
                }
            }
        }
        if (!extractionSuccess)
        {
            stage            = null;
            obstacleModel    = null;
            obstaclePosition = Vector2.zero;
        }
    }
Exemple #6
0
    public override void ExtractInterests(ChallengeStage stage)
    {
        ItemDatabase itemDatabase      = null;
        bool         extractionSuccess = false;

        base.ExtractInterests(stage);
        stageComponent = stage;
        if (stage != null)
        {
            itemDatabase = stage.GetItemDatabase();
            if (itemDatabase != null)
            {
                itemModel = itemDatabase.GetItemModel(itemCode);
                if ((itemModel != null) && stage.GetNodeStructurePosition(placementNodeID, ref itemPosition))
                {
                    itemPosition     += offsetWithinNode;
                    extractionSuccess = true;
                }
            }
        }
        if (!extractionSuccess)
        {
            stage        = null;
            itemModel    = null;
            itemPosition = Vector2.zero;
        }
    }
Exemple #7
0
 public virtual void ExtractInterests(ChallengeStage stage)
 {
     inputManager = null;
     if (stage != null)
     {
         inputManager = stage.GetInputManager();
     }
 }
Exemple #8
0
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
     if (stage != null)
     {
         agentComponent = stage.GetAgent(agentID);
     }
 }
Exemple #9
0
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
     if (stage != null)
     {
         cameraController = stage.GetCameraController();
         targetAgent      = (targetAgentID == BaseAgent.INVALID_AGENT_ID) ? null : stage.GetAgent(targetAgentID, targetNodeID);
     }
 }
 protected override void Awake()
 {
     base.Awake();
     agentComponent = null;
     stageComponent = null;
     waypoints      = null;
     routeAssigned  = false;
     routeTraveled  = false;
 }
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
     stageComponent = stage;
     if (stageComponent != null)
     {
         agentComponent = stageComponent.GetAgent(agentID);
         waypoints      = stageComponent.GetAllWaypoints();
     }
 }
Exemple #12
0
 protected override void Awake()
 {
     base.Awake();
     stageComponent = null;
     itemModel      = null;
     itemComponent  = null;
     itemPosition   = Vector2.zero;
     itemCreated    = false;
     itemObtained   = false;
     itemOver       = false;
 }
Exemple #13
0
 protected override void Awake()
 {
     base.Awake();
     stageComponent    = null;
     obstacleModel     = null;
     obstacleComponent = null;
     obstaclePosition  = Vector2.zero;
     obstacleCreated   = false;
     obstacleDestroyed = false;
     obstacleOver      = false;
 }
    private TextBoxManager()
    {
        textBoxParent      = null;
        boxObjects         = null;
        boxComponents      = null;
        boxMasterEvents    = null;
        boxQuestionRoles   = null;
        boxOptionIndexes   = null;
        boxSpeakerIDs      = null;
        boxTryAboves       = null;
        boxTailObjects     = null;
        boxTailRenderers   = null;
        symbolDatabase     = null;
        boxDatabase        = null;
        boxAppearanceIndex = -1;
        bodySpriteSystem   = null;
        bodySpriteDialogue = null;
        tailSpriteDialogue = null;
        tailWidth          = 0f;
        tailHeight         = 0f;
        tailHalfWidth      = 0f;
        tailHalfHeight     = 0f;
        stage                  = null;
        cameraObject           = null;
        cameraController       = null;
        cameraWidth            = 0f;
        cameraHeight           = 0f;
        cameraHalfWidth        = 0f;
        cameraHalfHeight       = 0f;
        cameraPixelWidth       = 0;
        cameraPixelHeight      = 0;
        boxDepth               = DisplayDepthManager.GetElementDepth(DisplayDepthManager.ELEMENT_CODE_TEXT);
        systemBoxLimits        = new Vector2(TextBox.DEFAULT_MAX_BOX_WIDTH, TextBox.DEFAULT_MAX_BOX_HEIGHT);
        systemBoxTopOffset     = 0f;
        dialogueBoxLimits      = new Vector2(DialogueBox.DEFAULT_MAX_D_BOX_WIDTH, DialogueBox.DEFAULT_MAX_D_BOX_HEIGHT);
        questionDelegate       = null;
        enunciateBoxTopOffset  = 0f;
        enunciateBoxComponent  = null;
        optionsToAllocate      = 0;
        optionAreaHeight       = 0f;
        optionHalfAreaHeight   = 0f;
        optionBoxTopOffset     = 0f;
        optionAwaitedIndex     = -1;
        optionChosenIndex      = -1;
        optionIndexConfirm     = -1;
        optionIndexCancel      = -1;
        optionComponentConfirm = null;
        optionComponentCancel  = null;
        paused                 = false;

        textBoxParent = new GameObject("TextBoxParent");
        textBoxParent.transform.position = new Vector3(0f, 0f, boxDepth);
    }
Exemple #15
0
 protected override bool SourceCompatible(GameObject candidateSource)
 {
     if (base.SourceCompatible(candidateSource))
     {
         triggerSourceComponent = triggerSourceObject.GetComponent <ChallengeStage>();
         if (triggerSourceComponent != null)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #16
0
    public override void ExtractInterests(ChallengeStage stage)
    {
        base.ExtractInterests(stage);
        if (stage != null)
        {
            agentComponent = stage.GetAgent(agentID);

            /*halmeida - A positioning event can only place the agent at a position within the currently
             * loaded structure (current room), because if the position change went through any doors, the
             * crossing of the door would not be registered and the loading of the scenery would break.*/
            waypointComponent = stage.GetWaypointFromCurrentStruct(waypointID);
        }
    }
    public void SetReferences(ChallengeStage newStage, CameraController newCameraController)
    {
        stage            = newStage;
        cameraController = newCameraController;
        if (cameraController != null)
        {
            if (cameraController.GetCameraOriginalWorldDimensions(ref cameraWidth, ref cameraHeight))
            {
                cameraHalfWidth  = cameraWidth / 2f;
                cameraHalfHeight = cameraHeight / 2f;
                cameraController.GetCameraPixelDimensions(ref cameraPixelWidth, ref cameraPixelHeight);
                cameraObject = cameraController.gameObject;

                /*halmeida - the y of the system box offset will carry the y info that doesn't vary. In this case,
                 * it's the y of the top of the text box.*/
                systemBoxTopOffset    = (SYSTEM_TEXT_TOP - 0.5f) * cameraHeight;
                enunciateBoxTopOffset = (ENUNCIATE_TEXT_TOP - 0.5f) * cameraHeight;
            }
        }
    }
Exemple #18
0
    protected override void Awake()
    {
        itemAnimator      = null;
        fireController    = null;
        waveEmitterIndex  = -1;
        waveEmitterObject = null;
        waveParams        = null;
        waveAnimator      = null;

        /*halmeida - set the animator to null because the Awake of the base class will call Clear(), and
         * the redefinition of Clear() in this class asks if the animator is null.*/
        base.Awake();
        triggerSourceComponent = null;
        triggerComponents      = null;
        triggeringComponents   = null;
        appearanceLevel        = APPEARANCE_LEVEL_FIRST;
        itemCollider           = GetComponent <Collider2D>();
        ExtractAnimators();
        originalScale = gameObject.transform.localScale;
        shrinkSpeed   = SHRINK_SPEED;
        shrinkAccel   = SHRINK_ACCEL;
        over          = false;
        obtainable    = false;
        effectType    = ItemData.EffectType.Money;
        effectSpeed   = 0f;
        if (itemData != null)
        {
            obtainable  = itemData.obtainable;
            effectType  = itemData.effectType;
            effectSpeed = itemData.effectValue;
        }
        scaleChangeDuration = 0f;
        scaleChangeElapsed  = 0f;
        startScale          = originalScale;
        targetScale         = originalScale;
        accumulatedEffect   = 0f;
    }
Exemple #19
0
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
 }
Exemple #20
0
    void Awake()
    {
        GameObject eventModel      = null;
        GameObject eventObject     = null;
        EventBase  eventComponent  = null;
        int        validEvents     = 0;
        int        insertionIndex  = -1;
        bool       nodeIDFound     = false;
        int        referencedNodes = 0;

        EventBase[] eventSet = null;

        eventObjects      = null;
        eventComponents   = null;
        eventNodeIDs      = null;
        eventsPerNode     = null;
        eventsWithoutNode = null;
        currentNodeID     = GraphNode.NODE_ID_INVALID;
        currentNodeEvents = null;
        stageComponent    = null;
        if (eventModels != null)
        {
            for (int i = 0; i < eventModels.Length; i++)
            {
                eventModel = eventModels[i];
                if (eventModel != null)
                {
                    eventComponent = eventModel.GetComponent <EventBase>();
                    if (eventComponent != null)
                    {
                        validEvents++;
                        nodeIDFound = false;
                        if (eventNodeIDs != null)
                        {
                            for (int j = 0; j < eventNodeIDs.Length; j++)
                            {
                                if (eventNodeIDs[j] == eventComponent.triggerNodeID)
                                {
                                    nodeIDFound = true;
                                }
                            }
                        }
                        if (!nodeIDFound)
                        {
                            UsefulFunctions.IncreaseArray <int>(ref eventNodeIDs, eventComponent.triggerNodeID);
                        }
                    }
                }
            }
        }
        if (validEvents > 0)
        {
            eventObjects    = new GameObject[validEvents];
            eventComponents = new EventBase[validEvents];
            if (eventNodeIDs != null)
            {
                referencedNodes = eventNodeIDs.Length;
                eventsPerNode   = new EventBase[referencedNodes][];
                for (int i = 0; i < referencedNodes; i++)
                {
                    eventsPerNode[i] = null;
                }
            }
            insertionIndex = 0;
            for (int i = 0; i < eventModels.Length; i++)
            {
                eventModel = eventModels[i];
                if (eventModel != null)
                {
                    eventComponent = eventModel.GetComponent <EventBase>();
                    if (eventComponent != null)
                    {
                        eventObject = Instantiate(eventModel) as GameObject;
                        eventObject.transform.SetParent(transform);
                        eventComponent = eventObject.GetComponent <EventBase>();
                        eventObjects[insertionIndex]    = eventObject;
                        eventComponents[insertionIndex] = eventComponent;
                        if (referencedNodes > 0)
                        {
                            /*halmeida - this means eventNodeIDs and eventsPerNode are not null and have
                             * their lengths equal to referencedNodes.*/
                            for (int j = 0; j < referencedNodes; j++)
                            {
                                if (eventNodeIDs[j] == eventComponent.triggerNodeID)
                                {
                                    eventSet = eventsPerNode[j];
                                    UsefulFunctions.IncreaseArray <EventBase>(ref eventSet, eventComponent);
                                    eventsPerNode[j] = eventSet;
                                }
                            }
                        }
                        insertionIndex++;
                    }
                }
            }
            /*halmeida - separate the events with an invalid trigger node ID value as events without node.*/
            if (referencedNodes > 0)
            {
                for (int i = 0; i < referencedNodes; i++)
                {
                    if (eventNodeIDs[i] == GraphNode.NODE_ID_INVALID)
                    {
                        eventsWithoutNode = eventsPerNode[i];
                        break;
                    }
                }
            }
        }
    }
Exemple #21
0
 public void SetStage(ChallengeStage newStageComponent)
 {
     stageComponent = newStageComponent;
 }
Exemple #22
0
 public void SetChallengeStage(ChallengeStage newChallengeStage)
 {
     challengeStage = newChallengeStage;
 }
Exemple #23
0
    protected virtual void Awake()
    {
        rbody              = GetComponent <Rigidbody2D>();
        pressingUpMove     = false;
        pressingUpAim      = false;
        pressingLeftMove   = false;
        pressingLeftAim    = false;
        pressingDownMove   = false;
        pressingDownAim    = false;
        pressingRightMove  = false;
        pressingRightAim   = false;
        standardDirections = null;
        CreateStandardDirections();
        directionMove             = Vector2.zero;
        directionAim              = Vector2.zero;
        directionPushed           = Vector2.zero;
        baseAccel                 = 0f;
        baseMaxSpeed              = 0f;
        baseMaxHP                 = 0f;
        baseAttack                = 0f;
        baseMaxFrequency          = 0f;
        finalAccel                = 0f;
        finalMaxSpeed             = 0f;
        finalMaxSpeedTemp         = 0f;
        finalMaxSpeedForced       = 0f;
        finalMaxSqrSpeed          = 0f;
        finalMaxSqrSpeedTemp      = 0f;
        finalMaxSqrSpeedForced    = 0f;
        finalMaxSpeedLerpSpeed    = 0f;
        finalMaxSpeedLerpTraveled = 0f;
        finalMaxHP                = 0;
        finalAttack               = 0f;
        finalMaxFrequency         = 0f;
        currentHP                 = 0;
        projectileInterval        = 0f;
        projectileElapsed         = 0f;
        projectileSpeed           = originalProjectileSpeed;
        projectileAccel           = originalProjectileAccel;
        projectileMaxSpeed        = originalProjectileMaxSpeed;
        projectileDuration        = originalProjectileDuration;
        destructionLevel          = ObstacleController.CONSTRUCTION_LEVEL_INVALID;
        dead = true;
        over = false;
        SetBaseStatsToOriginals(true);

        stopRequested         = false;
        pushedIntensity       = 0f;
        adversaryObjects      = null;
        adversaryComponents   = null;
        projectileObjects     = null;
        projectileComponents  = null;
        projectileLaunchFront = null;
        projectileLaunchBack  = null;
        visualEffectObjects   = null;
        visualEffectAnimators = null;
        ValidateVisualEffectModels();
        mainCollider = mainCollider2D;
        radius       = 0f;
        width        = 0f;
        height       = 0f;
        if (mainCollider == null)
        {
            mainCollider = GetComponent <Collider2D>();
        }
        if (mainCollider != null)
        {
            width  = mainCollider.bounds.size.x;
            height = mainCollider.bounds.size.y;
            radius = (width > height) ? width / 2f : height / 2f;
        }
        paused         = false;
        pausedVelocity = Vector2.zero;
        shouldUnpause  = false;
        currentName    = null;
        SetCurrentName(agentName);
        acceptsDamage        = true;
        triggersTransactions = true;
        forcingFinalMaxSpeed = false;
        challengeStage       = null;
        cameraController     = null;
        fontDamage           = null;
        fontColorDamage      = new Color(1f, 0.8f, 0.2f, 1f);
        fontColorHeal        = new Color(0.7f, 1f, 0.2f, 1f);
        fontGradientDamage   = new Vector4(0f, 5f, 0f, 0f);

        audioSourceDamageIn = null;
        audioSourceVoice    = null;
        damageInSounds      = null;
        damageInSoundIDs    = null;
        deathSounds         = null;
        deathSoundIDs       = null;

        /*halmeida - the AudioCenter is a plugin for reducing latency of sounds in Android devices. It also supports the sound
         * playback outside of the Android environment, but that support is really poor, with a single AudioSource. Because
         * of that, I don't wanna use it unless we are within the android environment.*/
                #if !UNITY_ANDROID || UNITY_EDITOR
        AddAudioSources();
        LoadAllSoundsFromResources();
                #else
        LoadAllSoundsIntoAudioCenter();
                #endif
    }
Exemple #24
0
 void Awake()
 {
     cameraObject           = null;
     cameraComponent        = null;
     cameraController       = null;
     inputCollider          = gameObject.GetComponent <BoxCollider2D>();
     inputColliderOriWidth  = 0f;
     inputColliderOriHeight = 0f;
     inputColliderAltWidth  = 0f;
     inputColliderAltHeight = 0f;
     inputColliderAltered   = false;
     colliderValid          = false;
     gameController         = null;
     challengeEditor        = null;
     challengeCanvas        = null;
     challengeStage         = null;
     menu                  = null;
     textBoxUIManager      = null;
     textBoxManager        = null;
     transactionBoxManager = null;
     loadVirtualKeypad     = false;
             #if UNITY_ANDROID && !UNITY_EDITOR
     loadVirtualKeypad = true;
             #endif
     interfaceCanvasObject      = null;
     interfaceCanvas            = null;
     interfaceCanvasScreenRect  = new Rect(0f, 0f, 0f, 0f);
     halfCanvasScreenWidth      = 0f;
     halfCanvasScreenHeight     = 0f;
     interfaceCanvasFactor      = 0f;
     stickLeftBackgroundObject  = null;
     stickLeftForegroundObject  = null;
     stickRightBackgroundObject = null;
     stickRightForegroundObject = null;
     stickLeftBackgroundTrans   = null;
     stickLeftForegroundTrans   = null;
     stickRightBackgroundTrans  = null;
     stickRightForegroundTrans  = null;
     stickLeftBackgroundImage   = null;
     stickLeftForegroundImage   = null;
     stickRightBackgroundImage  = null;
     stickRightForegroundImage  = null;
     buttonObjectPause          = null;
     buttonComponentPause       = null;
     buttonTriggerPause         = null;
     buttonImagePause           = null;
     actionPressPause           = null;
     visualBlockRequested       = false;
     functionalBlockRequested   = false;
     blockerEventIDs            = null;
     controlsEnabled            = false;
     virtualKeypadVisible       = false;
     cameraPixelWidth           = 0;
     cameraPixelHeight          = 0;
     draggingLeftStick          = false;
     draggingRightStick         = false;
     stickLeftNeutralPos        = Vector2.zero;
     stickLeftTiltedPos         = Vector2.zero;
     stickLeftDirection         = Vector2.zero;
     stickRightNeutralPos       = Vector2.zero;
     stickRightTiltedPos        = Vector2.zero;
     stickRightDirection        = Vector2.zero;
     stickActiveRadius          = STICK_ACTIVE_RADIUS;
     stickActiveRadiusSqr       = stickActiveRadius * stickActiveRadius;
     stickMaxRadius             = STICK_MAX_RADIUS;
     if (stickMaxRadius < stickActiveRadius)
     {
         stickMaxRadius = stickActiveRadius;
     }
     stickMaxRadiusSqr = stickMaxRadius * stickMaxRadius;
 }
Exemple #25
0
 public void SetStageAndCamera(ChallengeStage newChallengeStage, CameraController newCameraController)
 {
     challengeStage   = newChallengeStage;
     cameraController = newCameraController;
 }
Exemple #26
0
 protected override void AbandonInterests()
 {
     base.AbandonInterests();
     stageComponent = null;
     itemModel      = null;
 }
 protected override void Awake()
 {
     base.Awake();
     stageComponent = null;
     npcRemoved     = false;
 }
Exemple #28
0
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
     gameTextDatabase = GameTextDatabase.Instance;
     textBoxManager   = TextBoxManager.Instance;
 }
 public override void ExtractInterests(ChallengeStage stage)
 {
     base.ExtractInterests(stage);
     stageComponent = stage;
 }