rifaterdemsahin / aif

Adaptive Intelligence Framework
5 stars 7 forks source link

Tips on the screens ( Intro Task for new freelancers ) #255

Open rifaterdemsahin opened 6 years ago

rifaterdemsahin commented 6 years ago

Testing task for new freelancers.

we need it a prefab Here is the sample video https://drive.google.com/file/d/1M8toFf8wGOlntqv39NkSR5H1GNaMUX7E/view?usp=sharing

Screenrecording tools Bandicam Camtasia

abodaz commented 6 years ago

@rifaterdemsahin here's a screenshot if you didn't understand or it didn't work, we can use TeamViewer to solve it. image

rifaterdemsahin commented 6 years ago

Thanks for the detail. I will use this mapping and try to rename the assets accordingly if it does not work we can use TeamViewer.

rifaterdemsahin commented 6 years ago

This looks like a middle ground solution what do you think ? https://docs.google.com/document/d/1vk71YbTAbFkDhseLVni-8__jpG_jXLcmWQOTCzZBzH0/edit?usp=drivesdk

abodaz commented 6 years ago

yeah, the package should work, I don't know how I forget about it, maybe because you told me you want a prefab. so there is the package try it and tell how it goes.
https://drive.google.com/file/d/1E7HG6UiWbQJxhGPtgkRQj9wScH9tO1zY/view @rifaterdemsahin

rifaterdemsahin commented 6 years ago

We talked on using the parts

  1. getting package
  2. have test scene....( test the interaction code ) 3.prefab folder under the unique asset folder( 2 prefab folders) 4.map attirubute at the tag and tag the items

*Prefab and scene interaction code has tobe thought out.

image

rifaterdemsahin commented 6 years ago

@dorukugur here we disabled the story and it gets enabled after this prefab enters image

rifaterdemsahin commented 6 years ago

the prefab gets populated by other scenes we are looking for a way to use it practically over events. https://www.reddit.com/r/Unity3D/comments/9cpahl/how_to_use_prefabs_and_integrate_with_events/

would continue after resolving the issue here. Reason : prefabs not not getting used the way they should be used.( plug and plag we should not modify its content after getting it from the freelancer )

abodaz commented 6 years ago

Is that What we need? @rifaterdemsahin https://drive.google.com/file/d/1H9tK1Z_7NG9PsVXV9IEh8lMGVGhrR_J5/view

rifaterdemsahin commented 6 years ago

this is much better than mapping

rifaterdemsahin commented 6 years ago

please

rifaterdemsahin commented 6 years ago

assigning these at start is very good ...even better than tagging and trying to match them

Using enumarations will help with the process.

blackBG = transform.GetChild (1).gameObject; TipsImage = transform.GetChild (2).GetComponent(); FisrtPost = transform.GetChild (3).GetComponent(); LastPost = transform.GetChild (4).GetComponent(); closeBTN = transform.GetChild (2).GetChild(0).GetChild(1).GetComponent

rifaterdemsahin commented 6 years ago

assigning them in here in start makes sense image

and adding the delegate of the close function image

abodaz commented 6 years ago

Here I declared the enumerations, so it's easier to track the children objects from their names. image image

abodaz commented 6 years ago

This is the package after we solved the mapping problem in the TipsPanel. https://drive.google.com/open?id=100SNCPOXTOYAqX7ov2oGIw6st6EyjZGo

abodaz commented 6 years ago

In some versions of unity, this error will show when we drag and drop the prefab, error

I searched about that error and it turns out that it's a unity bug(in some versions). this is the link: https://issuetracker.unity3d.com/issues/aspectratiofitter-modifications-dot-empty-error-after-creating-object-from-prefab-which-has-aspect-ratio-fitter-attached

but it won't affect the project, you can play the scene with no problem, and once you cleared the console it won't appear another time until you drag the prefab again.

rifaterdemsahin commented 6 years ago

can it be this ?

Post ReplyPrefab Value Assignments

from TaylorFowler via /r/Unity3D sent an hour ago Awake is called before start and both are called in a random order.

A good rule of thumb is to use the Awake method to setup the current objects members that don't rely on external objects being initialised. Use start for interacting with other components and getting references to objects.

For example, say you had a SetupUI class that used it's Awake method to create the game objects required by the UIManager. If the UIManager has its Awake method executed before the SetupUI component's Awake method, then you would get null references and eventually get runtime errors when you treat the null reference as a valid object.

Here's some more info: https://forum.unity.com/threads/start-vs-awake.41633/

dorukugur commented 6 years ago

image

I added this line(35), it's working clearly to close tips panel and to open menu map with SetActiveMenuMap method(line 50). So, we can use that system for all scenes. It runs prefab independently. Only close button must drag&drop to myPrefabTipCloseButton(line 25).

@rifaterdemsahin @abodaz

Neutrinora commented 6 years ago

Also you may want to try this way

`public GameObject blackBG; //Has been set on the inspector public Image TipsImage; //Has been set on the inspector public Image FirstPost; //Has been set on the inspector public Image LastPost; //Has been set on the inspector public Button closeBTN; //Has been set on the inspector void Start() {

    if (blackBG == null)
        blackBG = transform.Find("BlackBG").gameObject;

    if (TipsImage == null)
        TipsImage = transform.Find("TipsPanel").GetComponent<Image>();

    if (FirstPost == null)
        FirstPost = transform.Find("FirstPost").GetComponent<Image>();

    if (LastPost == null)
        LastPost = transform.Find("LastPost").GetComponent<Image>();

    if (closeBTN == null)
        closeBTN = TipsImage.transform.Find("InsidePanel").Find("CloseBTN").GetComponent<Button>();
}`
rifaterdemsahin commented 6 years ago

@Neutrinora thanks for the input. Here is the reddit thread on where to assign the prefab values it focused on the awake. image

rifaterdemsahin commented 6 years ago

Reason of using the awake image

Neutrinora commented 6 years ago

If we're not going to modify prefabs when using them, them we have no problema about losing references. We don't need to assign references on beginning, instead learning the ways how to keep references on inspector

Rules not to lose references.

rifaterdemsahin commented 6 years ago

Binoys implelementation https://youtu.be/E8BlBm0kHXY